package com.le.tester.javaThink.fifth.chapter24_ConcurrentProgramming;


import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * createTime：2021/8/17 15:56
 * description：CollectionIntoStream 集合和流的使用
 */
public class CollectionIntoStream {
    public static void main(String[] args) {
        List<Integer> integers =
                Stream.generate(() -> new Random(47).nextInt(10))
                        .limit(5)
                        .collect(Collectors.toList());

        integers.forEach(System.out::println);

        Long result = (long) integers.size();
        System.out.println(result);
    }
}
